]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Store sections by device type
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Aug 2022 14:19:43 +0000 (16:19 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 10 Aug 2022 12:17:19 +0000 (12:17 +0000)
Now that the indicator no longer needs to map connections
to device wrappers, we can drop the custom 'category' type
and just use the device type.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2407>

js/ui/status/network.js

index 5481d7191cf10a58c9051d27f90d15b9140dabb0..148169b464640ff4f2b437b518e369b6c4d3d106 100644 (file)
@@ -16,15 +16,6 @@ Gio._promisify(Gio.DBusConnection.prototype, 'call');
 Gio._promisify(NM.Client, 'new_async');
 Gio._promisify(NM.Client.prototype, 'check_connectivity_async');
 
-const NMConnectionCategory = {
-    INVALID: 'invalid',
-    WIRED: 'wired',
-    WIRELESS: 'wireless',
-    BLUETOOTH: 'bluetooth',
-    WWAN: 'wwan',
-    VPN: 'vpn',
-};
-
 const MAX_VISIBLE_NETWORKS = 8;
 var MAX_DEVICE_ITEMS = 4;
 
@@ -1641,10 +1632,10 @@ class Indicator extends PanelMenu.SystemIndicator {
         this._btSection = new NMBluetoothSection();
 
         this._deviceSections = new Map([
-            [NMConnectionCategory.WIRED, this._wiredSection],
-            [NMConnectionCategory.WIRELESS, this._wirelessSection],
-            [NMConnectionCategory.WWAN, this._modemSection],
-            [NMConnectionCategory.BLUETOOTH, this._btSection],
+            [NM.DeviceType.ETHERNET, this._wiredSection],
+            [NM.DeviceType.WIFI, this._wirelessSection],
+            [NM.DeviceType.MODEM, this._modemSection],
+            [NM.DeviceType.BT, this._btSection],
         ]);
         for (const section of this._deviceSections.values()) {
             section.connectObject(